import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    isCollapse: true,
    personId: "",
    consultantId: "",
    platformName: "",
    AllPermissionList: [],
    AppKey: "",
    refreshDetailData: ''
  },
  getters: {
    GET_IS_COLLAPSE(state) {
      return state.isCollapse;
    },
    GET_ALL_PERMISSION_LIST(state) {
      return state.AllPermissionList;
    },
    GET_REFRESH_DETAIL_DATA(state) {
      return state.refreshDetailData;
    },
  },
  mutations: {
    SET_IS_COLLAPSE(state, isCollapse) {
      state.isCollapse = isCollapse;
    },
    SET_PERSON_ID(state, newPersonId) {
      state.personId = newPersonId;
    },
    SET_CONSULTANT_ID(state, newConsultantId) {
      state.consultantId = newConsultantId;
    },
    SET_PLATFORM_NAME(state, platformName) {
      state.platformName = platformName;
    },
    SET_ALL_PERMISSION_LIST(state, AllPermissionList) {
      state.AllPermissionList = AllPermissionList;
    },
    SET_APP_KEY(state, AppKey) {
      state.AppKey = AppKey;
    },
    SET_REFRESH_DETAIL_DATA(state, data) {
      state.refreshDetailData = data;
    },
  },
  modules: {},
});
